package com.tq.model;

import java.io.Serializable;

import com.tq.util.JsonUtil;


import android.text.TextUtils;

public class Result implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4471961997025265465L;
	
	private int version;
	private int code;
	
	private String msg;

	
	
	
	
	
	public Result() {
	}

	public Result(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public <T> T getResult(Class<T> clz)
	{
		
		if(TextUtils.isEmpty(msg))
		{
			return null;
		}
		
		return JsonUtil.fromJson(msg, clz);
	}
	
	
	
	

}
